/*
day74
2019.11.10 
*/

#include<vector>
#include<queue>

using namespace std;

struct TreeNode {
	int val;
	struct TreeNode *left;
	struct TreeNode *right;
};


class Solution {
public:
    vector<vector<int>> levelOrder(TreeNode* root) {
        
		vector<vector<int>> vec_res;
		
        queue<TreeNode *> q;
        if(root) q.push(root);
        
        while( !q.empty() )
        {
        	vector<int> vec;
        	int time=q.size();
        	for(int i=0;i<time;i++)
        	{
        		TreeNode *cur=q.front();
        		q.pop();
        		if(cur->left) q.push(cur->left);
        		if(cur->right) q.push(cur->right);
        		vec.push_back(cur->val);
			}
			vec_res.push_back(vec);
        
		}
		
		return vec_res; 
    }
};


int main()
{
	return 0;
}
